const baseUrl='http://localhost:8082'
export const myRequest =(options)=>{
	return new Promise((resolve,reject)=>{
		uni.request({
			url:baseUrl+options.url,
			data:options.data || {},
			method:options.method || 'GET',
			success:(res)=>{
				console.log('res:', res)
				if (res.data.status!==0){
					return uni.showToast({
					title:'返回数据失败'
					})
		        }
				resolve(res)
			},
			fail:(err)=>{
				uni.showToast({
				title:'请求接口失败'
				})
				reject(err)
			}
		})
	})
	
}

